package com.todod.base.module.infra.dal.mysql.baseofficialletter;

import com.todod.base.framework.mybatis.core.mapper.BaseMapperX;
import com.todod.base.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.todod.base.module.infra.dal.dataobject.baseofficialletter.BaseOfficialLetterFileDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 公函明细 Mapper
 *
 * @author 平台管理员
 */
@Mapper
public interface BaseOfficialLetterFileMapper extends BaseMapperX<BaseOfficialLetterFileDO> {
    /**
     * 获得公函附件列表
     *
     * @param officialLetterId 公函明细
     * @return 公函明细列表
     */
    default List<BaseOfficialLetterFileDO> getSimpleLetterFileList(Long officialLetterId) {
        return selectList(new LambdaQueryWrapperX<BaseOfficialLetterFileDO>()
                .eqIfPresent(BaseOfficialLetterFileDO::getOfficialLetterId, officialLetterId)
        );
    }
}